<p class="Paragraph">Condition: Any expression which controls whether the statement block following the respective Case clause is executed.</p>
<p class="Paragraph">Expression : Any expression compatible with the Condition type expression. The statement block following the Case clause is executed if <span class="T1">Condition</span> matches <span class="T1">Expression</span>.</p>
<p class="P2">Example:</p>
<p class="PropText">Sub ExampleRandomSelect</p>
<p class="PropText">Dim iVar As Integer</p>
<p class="PropText">iVar = Int((15 * Rnd) -2)</p>
<p class="PropText">Select Case iVar</p>
<p class="PropText">Case 1 To 5</p>
<p class="PropText">Print "Number from 1 to 5"</p>
<p class="PropText">Case 6, 7, 8</p>
<p class="PropText">Print "Number from 6 to 8"</p>
<p class="PropText">Case Is > 8 And iVar < 11</p>
<p class="PropText">Print "Greater than 8"</p>
<p class="PropText">Case Else</p>
<p class="PropText">Print "Out of range 1 to 10"</p>